From: Georges Basile Stavracas Neto Date: Sat, 4 Feb 2023 15:25:01 +0000 (-0300) Subject: status/network: Improve network toggle subtitles X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~87 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=01a89bc29ac5602d53c0e291f20ac29331286bf9;p=gnome-shell.git status/network: Improve network toggle subtitles If there is a single connection for a given NMToggle subclass, use the connection name; otherwise, transform that into '%d connected'. This is better than the current "Device (counter)" template, e.g. "VPN (2)", which would give us a quick toggle with: VPN VPN (2) Change that to e.g.: VPN 2 connected Part-of: --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 781e298a4..2fa08cca9 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1363,13 +1363,13 @@ const NMToggle = GObject.registerClass({ // transform function for property binding: // Ignore the provided label if there are multiple active - // items, and replace it with something like "VPN (2)" + // items, and replace it with something like "2 connected" _transformSubtitle(source) { const nActive = this.checked ? [...this._getActiveItems()].length : 0; if (nActive > 1) - return `${this._getDefaultName()} (${nActive})`; + return ngettext('%d connected', '%d connected', nActive).format(nActive); return source; }